import random
# 求和循环
a = 0
sum = 0
while a <= 100:
    sum += a
    a += 1

print(f"恭喜你答对啦！！！！！----{sum}")
num = int(random.randint(1,10))
print(f"随机数为{num}")
userName = int(input("请输入一个数"))
time =int(random.randint(3,5))
i = 0
while i<= time:
    if userName != num:
        print(f"你答错啦！！！！！,你还剩{time - i }次机会")
        userName = int(input("请再输入一个数"))
        i += 1
        if i == time:
            print("很遗憾次数用完了！！！！！")
            break
    else:
        print("恭喜你答对啦！！！！！")
        break
# 99乘法表
i=1
while i <= 9:
    j = 0
    while j <= 9:
        if j >= i :
            if j == 9:
                print((f"{i} * {j} = {i * j}\t"))
            else:
                print((f"{i} * {j} = {i*j}\t"),end="")
        j += 1
    i += 1